package org.microframework.cloud.logs.model.dto;

import java.util.List;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * API调用日志统计结果
 *
 * @author zs
 * @version 1.0.0
 * @since 2024-06-14
 */
@Data
@Schema(description = "API调用日志统计结果")
public class ApiLogStatsDTO {
    
    @Schema(description = "总调用次数")
    private Long totalCount;
    
    @Schema(description = "错误调用次数")
    private Long errorCount;
    
    @Schema(description = "调用量前10的API列表")
    private List<ApiTopDTO> apiTopList;
    
    @Data
    @Schema(description = "API调用量排行")
    public static class ApiTopDTO {
        
        @Schema(description = "接口名称")
        private String apiName;
        
        @Schema(description = "调用次数")
        private Long count;
        
        @Schema(description = "平均调用时长(毫秒)")
        private Double avgDuration;
    }
} 